package cn.com.surker.material.service;

import cn.com.surker.material.entity.MainMaterialContractPrice;
import cn.com.surker.material.entity.MainMaterialTransportCar;
import cn.com.surker.spring.RestResultDto;
import cn.com.surker.vo.main.MainMaterialPriceVo;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;
import java.util.Map;

/**
 * @Author lucky
 * @create 2024年09月03 21:26
 * @desc
 */
public interface MaterialPriceBaseService {

    /**
     * 分页查询价格
     * @param searchVal
     * @param contractId
     * @param offset
     * @param limit
     * @return
     */
    IPage findPage(String searchVal, Long contractId, Integer offset, Integer limit);

    /**
     * 根据合同查询材料单价
     * @param contractId
     * @return
     */
    Map<String, List<MainMaterialContractPrice>> findByContract(Long contractId);

    /**
     * 根据合同查询材料单价信息
     * @param contractId
     * @param type
     * @return
     */
    List<MainMaterialPriceVo> findByContract(Long contractId, Integer type);
    List<MainMaterialPriceVo> findByContractV1(Long contractId, Integer type);

    /**
     * 保存合同价格
     * @param contractPrice
     * @return
     */
    RestResultDto save(MainMaterialContractPrice contractPrice);

    MainMaterialContractPrice findNextPrice(Long orgId, Long supplierId, Long transportId, Long materialId,
                                            Integer type, String startTime, String endTime);

    /**
     * 批量新增
     * @param list
     * @return
     */
    RestResultDto saveBatch(List<MainMaterialContractPrice> list, String creator);

    /**
     * 更新合同价格
     * @param contractPrice
     * @return
     */
    RestResultDto updateContractPrice(MainMaterialContractPrice contractPrice);

    /**
     * 禁用合同价格
     * @param id
     * @param status
     * @return
     */
    RestResultDto updateStatus(Long id, Integer status, String creator);

    /**
     * 新增运输合同车辆
     * @param contractId
     * @param carNo
     * @param remark
     * @param creator
     * @return
     */
    RestResultDto saveContractCar(Long contractId, String carNo, String remark, String creator, String today,
                                  String startTime, String endTime, Long supplierId);

    /**
     * 新增运输合同车辆
     * @param contractId
     * @param carNos
     * @param remark
     * @param creator
     * @return
     */
    RestResultDto saveBatchContractCar(Long contractId, String carNos, String remark, String creator, String today,
                                       String startTime, String endTime, Long supplierId);

    /***
     * 批量删除绑定车辆
     * @param ids
     * @param creator
     * @return
     */
    RestResultDto deleteBatchContractCar(String ids, String creator);

    /**
     * 禁用合同车牌
     * @param id
     * @param creator
     * @return
     */
    RestResultDto updateContractCarStatus(Long id, String creator);

    /**
     * 查询运输合同车辆
     * @param contractId
     * @return
     */
    List<MainMaterialTransportCar> findByContractCar(Long contractId, String today, Long supplierId);

    /**
     * 查询某个合同下运输的车牌信息
     * @return
     */
    List<MainMaterialTransportCar> findTodayWeightCar(Long orgId, Long contractId, Long supplierId, String startTime, String endTime);

    /**
     * 复制车牌号
     * @return
     */
    RestResultDto copyCarNo(Long contractId, Long copySupplierId, String copyToday, String today, String startTime,
                            String endTime, Long newSupplierId, String remark, String creator);

    /**
     * 材料运输车辆分页
     * @param searchVal
     * @param contractId
     * @param offset
     * @param limit
     * @return
     */
    IPage findContractCarPage(String searchVal, Long contractId, String today, Long supplierId, Integer offset, Integer limit);

    /**
     * 更新车辆信息
     * @param transportCar
     * @return
     */
    RestResultDto updateContractCar(MainMaterialTransportCar transportCar);
}
